﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryGLOPITEM(DataRow dwData, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1 = OracleDB.CreateCommand();
            // APZMANDANT  APZART APZVAR APZANRKRS APZALFDNR APZSTUFE
            switch (option)
            {
                case 1:
                    or1.CommandText = "SELECT * FROM GLOPITEM WHERE  "
                    + "  GLOMANDANT=:GLOMANDANT AND GLOITEM=:GLOITEM";
                    or1.Parameters.Add("GLOMANDANT", OracleType.NVarChar).Value = dwData["GLOMANDANT"].ToString();
                    or1.Parameters.Add("GLOITEM", OracleType.NVarChar).Value = dwData["GLOITEM"].ToString();
                    break;      //VKKOPITEM
            }

            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "GLOPITEM";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
    }
}
